<template>
  <div class="learn-main-page">
    <PageHeader></PageHeader>
    <div class="learn-page-user">
      <div class="page-body user-info d-flex">
        <div class="info-left d-flex">
          <a href="#" class="user-avatar">
            <img :src="user.data.avatar" alt="用户头像">
          </a>
          <div class="user-desc">
            <p class="user-name">{{user.data.username}}</p>
            <p class="user-sign"><a href="#" style="color:#fff;">"{{user.data.sign}}"</a></p>
          </div>
        </div>
        <div class="info-right">
          <ul class="font-white">
            <li>
              <span>学分</span>
              <a href="#" class="font-white">0</a>
            </li>
            <li class="line"></li>
            <li>
              <span>等级</span>
              <a href="#" class="font-white">0</a>
            </li>
            <li class="line"></li>
            <li>
              <span>金币</span>
              <a href="#" class="font-white">0</a>
            </li>
          </ul>
        </div>
      </div>
    </div>
    <div class="learn-page-more">
      <h2>更多动态</h2>
    </div>
    <PageFooter></PageFooter>
  </div>
</template>

<script>
import PageHeader from '../PageHeader'
import PageFooter from '../PageFooter'
import { reactive, onMounted } from 'vue'
import { getCurrentUser } from '../../api'
export default {
  components: {
    PageHeader,
    PageFooter
  },
  setup () {
    const user = reactive({
      data: []
    })
    onMounted(async () => {
      const res = await getCurrentUser()
      console.log(res.data)
      user.data = res.data
    })
    return { user }
  }
}
</script>

<style lang="scss" scoped>
.learn-main-page {
  width: 100%;
  .learn-page-user {
    width: 100%;
    height: 174px;
    background-color: #fff;
    background: url('http://www.howzhi.com/assets/img/howzhi/studyCenter-banner.jpg');
    background-size: cover;
    .user-info {
      align-items: center;
      justify-content: space-between;
      .info-left {
        align-items: center;
        .user-avatar {
          width: 100px;
          height: 100px;
          margin-right: 20px;
          img {
            width: 90px;
            height: 90px;
            border-radius: 50%;
            margin: 5px auto;
            border: 5px solid rgba(155, 155, 155, 0.6);
            &:hover {
              border-color: #08ac4c;
            }
          }
        }
        .user-desc {
          color: white;
          font-size: 16px;
          p {
            margin-bottom: 5px;
          }
        }
      }
      .info-right {
        ul {
          list-style: none;
          display: flex;
          margin-bottom: 0;
          li {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin: 0px 16px;
            &.line {
              height: 50px;
              width: 1px;
              background: rgba(255, 255, 255, 0.4);
              position: relative;
              top: 28px;
            }
            span {
              margin-bottom: 10px;
            }
            a {
              font-size: 30px !important;
            }
          }
        }
      }
    }
  }
  .learn-page-more {
    height: 300px;
    width: 100%;
    background-color: #f4f6f8;
    text-align: center;
  }
}
</style>
